public class Phone {
    String brand;
    String model;
    double price;
    int storage;
    int batteryLife;

    public void setDetails(String brand, String model, double price, int storage, int batteryLife) {
        this.brand = brand;
        this.model = model;
        this.price = price;
        this.storage = storage;
        this.batteryLife = batteryLife;
    }
    public void charge(int amount) {
        this.batteryLife = batteryLife+amount;
    }
    public void useBattery(int amount) {
        this.batteryLife = batteryLife - amount;
    }
    public boolean isLowBattery() {
        if(this.batteryLife < 20) {
            return true;
        }else {
            return false;
        }
    }
    public void ShowInfo() {
        System.out.println("品牌" +brand+"型号"+model+"价格"+price+"存储容量" + storage+"电池电量"+batteryLife);
    }

    public static void main(String[] args) {
        Phone phone = new Phone();
        phone.setDetails("华为","123",1233,225,100);
        phone.charge(12);
        phone.useBattery(23);
        phone.ShowInfo();
        if(phone.isLowBattery()) {
            System.out.println("电量小于20%");
        }
    }
}
